﻿<Window x:Class="Mimic.MainWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:Mimic="clr-namespace:Mimic"
		Title="Mimic" Height="500" Width="600" WindowStyle="ToolWindow"
		WindowStartupLocation="CenterOwner" Loaded="Window_Loaded"
		Icon="/Mimic;component/Resources/tv.ico" ShowInTaskbar="False" Topmost="True">
    <Window.Resources>
        <Mimic:VisibilityConverter x:Key="VisibilityConverter" />
        <Mimic:RefreshLabelConverter x:Key="RefreshLabelConverter" />
        <Mimic:ToolTipMsgConverter x:Key="ToolTipMsgConverter" />
        <DataTemplate x:Key="ThumbnailList">
            <Mimic:ThumbControl Source="{Binding}" Margin="10" ClientAreaOnly="False"
                                Visibility="{Binding IsExpanded, ElementName=listEltExpander, Converter={StaticResource VisibilityConverter}, Mode=OneWay}"
                                AllowMinimizeInTray="True" MouseDoubleClick="Thumbnail_MouseDoubleClick" />
        </DataTemplate>
        <LinearGradientBrush x:Key="shinyBrush" StartPoint="0,0" EndPoint="0,1">
            <GradientStop Offset="0" Color="Gray"/>
            <GradientStop Offset="0.3" Color="#FF222222"/>
            <GradientStop Offset="0.3" Color="Black"/>
            <GradientStop Offset="0.9" Color="Black"/>
            <GradientStop Offset="0.9" Color="#FF222222"/>
            <GradientStop Offset="1" Color="Gray"/>
        </LinearGradientBrush>
    </Window.Resources>
    <DockPanel >
        <Expander BorderThickness="0" Name="listEltExpander" DockPanel.Dock="Left" ExpandDirection="Left"
				  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsExpanded="True"
			      ToolTip="{Binding IsExpanded, RelativeSource={RelativeSource Self}, Converter={StaticResource ToolTipMsgConverter}, Mode=OneWay}">
            <ListBox BorderThickness="0" Background="Transparent" Width="200" ItemsSource="{Binding}"
                     ItemTemplate="{StaticResource ThumbnailList}" IsSynchronizedWithCurrentItem="True"
                     ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.CanContentScroll="False" />
        </Expander>
        <Button DockPanel.Dock="Top" Height="50" Click="Button_Click" Focusable="False" Background="{StaticResource shinyBrush}" >
            <Button.BitmapEffect>
                <BevelBitmapEffect />
            </Button.BitmapEffect>
            <WrapPanel>
                <CheckBox Name="cbRefresh" VerticalAlignment="Center" ToolTip="Show all windows" />
                <TextBlock Background="Transparent" FontSize="16" VerticalAlignment="Center" Foreground="LightGoldenrodYellow"
					       Text="{Binding IsChecked, ElementName=cbRefresh, Converter={StaticResource RefreshLabelConverter}, Mode=OneWay}" />
			</WrapPanel>
        </Button>
        <Rectangle DockPanel.Dock="Bottom" Height="10" Fill="{StaticResource shinyBrush}"/>
        <TextBox DockPanel.Dock="Bottom" VerticalAlignment="Center" Background="Transparent" Foreground="Yellow"
				 IsReadOnly="True" Text="{Binding WindowName, ElementName=Thumb, Mode=OneWay}" BorderThickness="0" />
        <Rectangle DockPanel.Dock="Bottom" Height="10" Fill="{StaticResource shinyBrush}"/>
        <Mimic:ThumbControl x:Name="Thumb" Source="{Binding /}" Margin="10" ClientAreaOnly="False" AllowMinimizeInTray="True"
                            MouseDoubleClick="Thumbnail_MouseDoubleClick" />
    </DockPanel>
</Window>
